﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;
using BLL;

namespace Web.admin.OutterManage
{
    public partial class OutterPictures : System.Web.UI.Page
    {
        OutterPhotosSevice photoService = new OutterPhotosSevice();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request["id"];
                if (String.IsNullOrEmpty(id))
                    return;
                //btn_Add.NavigateUrl = "AddOutterPhotos.aspx?ParticipantsId=" + id;
                BoParticipants part = new BoParticipants();
                part.PAR_ID = id;
                IList<BoOutterPhotos> photos = photoService.GetParticipantsPhotos(part);
                foreach (BoOutterPhotos p in photos)
                {
                    p.OPHO_URL = "/UploadImages/" + p.OPHO_URL;
                }

                DataList1.DataSource = photos;
                DataList1.DataBind();
            }
        }

        /// <summary>
        /// 跳到AddOutterPhotos.aspx页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GoToAddOutter(object sender, EventArgs e)
        {
            Response.Redirect("AddOutterPhotos.aspx?ParticipantsId=" + Request["id"]);
        }
    }
}